package main

import "fmt"

func main() {

	//结构体person
	type Person struct {
		//string型字段name
		//int 型的字段age
		name   string
		age    int
		gender int
	}

	//实例化person类型的变量alice
	var alice Person
	alice.name = "alice"
	alice.gender = 1
	alice.age = 25
	//输出alice名字段的值
	fmt.Println("姓名:", alice.name)
	fmt.Println("年纪:", alice.age)
	fmt.Println("性别:", alice.gender)
	fmt.Println("alice的值为:", alice)

	//实例化person类型的变量bob
	var bob Person
	bob.name = "bob"
	bob.gender = 0
	bob.age = 28

	//输出bob各个类型的值
	fmt.Println("bob的值为:", bob)
	//实例化person类型的变量cindy
	var cindy Person
	cindy.name = "alice"
	cindy.gender = 1
	cindy.age = 18
	//输出cindy各字段的值
	fmt.Println("cindy的值为：", cindy)
}
